]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Work around glitches with hover tracking
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Feb 2015 20:12:53 +0000 (21:12 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 20 Feb 2015 16:40:48 +0000 (17:40 +0100)
St's hover tracking uses ClutterInputDevice, which unfortunately may use
an outdated cursor position to determine which actor is hovered. Using
MetaCursorTracker instead would fix this, but would require linking St with
libmutter - avoid this for now by manually fixing up Clutter's view of
the pointer position in the case where we rely on it working properly.

https://bugzilla.gnome.org/show_bug.cgi?id=744850

js/ui/messageTray.js

index 6b19d200438d0406bf16fa94b690fedcf025a62e..2e400dc8260d7b790574857f4852bfd898c26d2b 100644 (file)
@@ -1369,6 +1369,18 @@ const MessageTray = new Lang.Class({
             this._onStatusChanged(status);
         }));
 
+        global.stage.connect('enter-event', Lang.bind(this,
+            function(a, ev) {
+                // HACK: St uses ClutterInputDevice for hover tracking, which
+                // misses relevant X11 events when untracked actors are
+                // involved (read: the notification banner in normal mode),
+                // so fix up Clutter's view of the pointer position in
+                // that case.
+                let related = ev.get_related();
+                if (!related || this.actor.contains(related))
+                    global.sync_pointer();
+            }));
+
         this.actor = new St.Widget({ name: 'notification-container',
                                      reactive: true,
                                      track_hover: true,